#include"StrMatching .h"

myI myBF(string pattern, string text) {
	myI n = pattern.length();
	myI m = text.length();
	if (m > n||m==0)
		return -1;
	for (myI i=0;i<n;i++) {
		myI j = i;
		for (;j<m;j++) {
			if (pattern.at(i+j)!=text.at(j)) {
				break;
			}
		}
		if (j==m) {
			return i;
		}
	}
	return -1;
}